package com.qingke.hibernate.bean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name="course_model")
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public class CourseModel {
	@Id
	@Column(name="id")
	private int id;
	
	
	@ManyToOne
	@JoinColumn(name="course_type_id")
	private CourseType courseType;
	
	@ManyToOne
	@JoinColumn(name="course_id")
	private Course course;
	
	@ManyToOne
	@JoinColumn(name="major_id")
	private Major major;
	
	@ManyToOne
	@JoinColumn(name="course_set_id")
	private CourseSet courseSet;
	
	@ManyToOne
	@JoinColumn(name="school_year_id")
	private SchoolYear schoolYear;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public CourseType getCourseType() {
		return courseType;
	}

	public void setCourseType(CourseType courseType) {
		this.courseType = courseType;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public Major getMajor() {
		return major;
	}

	public void setMajor(Major major) {
		this.major = major;
	}

	public CourseSet getCourseSet() {
		return courseSet;
	}

	public void setCourseSet(CourseSet courseSet) {
		this.courseSet = courseSet;
	}

	public SchoolYear getSchoolYear() {
		return schoolYear;
	}

	public void setSchoolYear(SchoolYear schoolYear) {
		this.schoolYear = schoolYear;
	}

	@Override
	public String toString() {
		return "CourseModel [id=" + id + ", courseType=" + courseType + ", course=" + course + ", major=" + major
				+ ", courseSet=" + courseSet + ", schoolYear=" + schoolYear + "]";
	}
	
	
	
	
}
